#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QVector>
#include <QPoint>
#include <QThread>

#include "CWorker.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:

    void bindSlotAndSignals();

private slots:
    void slotGetBezierDispersedPoints(QPoint);

    void slotClearAll();

    void on_pushButton_startFit_clicked();

    void on_pushButton_clearPoints_clicked();

    void on_checkBox_paintLine_stateChanged(int arg1);

    void on_checkBox_paintBezierCurve_stateChanged(int arg1);

signals:

    void signalClearWidgetPoints();

    void signalSendStartFit(quint8 order, QVector<QPoint> points);

    void signalSendPaintLineFlag(bool);

    void signalSendPaintCurveFlag(bool);

private:
    Ui::Widget *ui;

    QThread * m_thread;
    CWorker * m_worker;

    QVector<QPoint> m_bezier_dispersed_points;
};
#endif // WIDGET_H
